gtk: Add the GtkRoot interface
authorBenjamin Otte <otte@redhat.com>
Fri, 6 Apr 2018 18:21:06 +0000 (20:21 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 15 Feb 2019 05:53:17 +0000 (06:53 +0100)
So far, this doesn't do anything.

gtk/gtk.h
gtk/gtkroot.c [new file with mode: 0644]
gtk/gtkroot.h [new file with mode: 0644]
gtk/gtktypes.h
gtk/meson.build

index c79f1a9dfb8664a3ac52add0e75cc08502b65e35..368ce0ca699f693e9bcfa69ea0e594e89af29aa3 100644 (file)
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
 #include <gtk/gtkrecentmanager.h>
 #include <gtk/gtkrender.h>
 #include <gtk/gtkrevealer.h>
+#include <gtk/gtkroot.h>
 #include <gtk/gtkscale.h>
 #include <gtk/gtkscalebutton.h>
 #include <gtk/gtkscrollable.h>
diff --git a/gtk/gtkroot.c b/gtk/gtkroot.c
new file mode 100644 (file)
index 0000000..3eecc97
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2018 Benjamin Otte
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Benjamin Otte <otte@gnome.org>
+ */
+
+#include "config.h"
+
+#include "gtkroot.h"
+
+/**
+ * SECTION:root
+ * @Title: GtkRoot
+ * @Short_description: Root widgets
+ * @See_also: #GtkWindow
+ *
+ * #GtkRoot is the interface implemented by all widgets that can act as a toplevel
+ * widget to a hierarchy of widgets. The root widget takes care of providing the
+ * connection to the windowing system and manages layout, drawing and event delivery
+ * for its widget hierarchy.
+ *
+ * The obvious example of a #GtkRoot is #GtkWindow.
+ */
+
+G_DEFINE_INTERFACE (GtkRoot, gtk_root, GTK_TYPE_WIDGET)
+
+static void
+gtk_root_default_init (GtkRootInterface *iface)
+{
+}
+
diff --git a/gtk/gtkroot.h b/gtk/gtkroot.h
new file mode 100644 (file)
index 0000000..e4894ee
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright © 2018 Benjamin Otte
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Benjamin Otte <otte@gnome.org>
+ */
+
+#ifndef __GTK_ROOT_H__
+#define __GTK_ROOT_H__
+
+#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
+#error "Only <gtk/gtk.h> can be included directly."
+#endif
+
+#include <gdk/gdk.h>
+#include <gtk/gtkwidget.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_ROOT               (gtk_root_get_type ())
+
+GDK_AVAILABLE_IN_ALL
+G_DECLARE_INTERFACE (GtkRoot, gtk_root, GTK, ROOT, GtkWidget)
+
+/**
+ * GtkRootIface:
+ *
+ * The list of functions that must be implemented for the #GtkRoot interface.
+ */
+struct _GtkRootInterface
+{
+  /*< private >*/
+  GTypeInterface g_iface;
+
+  /*< public >*/
+};
+
+
+G_END_DECLS
+
+#endif /* __GTK_ROOT_H__ */
index fc58058821f6b9c262e6d00207a7e6a7c7c783e4..5d1218f189888752ce6cb13666aeff63453f23ef 100644 (file)
@@ -39,6 +39,7 @@ typedef struct _GtkClipboard         GtkClipboard;
 typedef struct _GtkEventController     GtkEventController;
 typedef struct _GtkGesture             GtkGesture;
 typedef struct _GtkRequisition        GtkRequisition;
+typedef struct _GtkRoot               GtkRoot;
 typedef struct _GtkSelectionData       GtkSelectionData;
 typedef struct _GtkSettings            GtkSettings;
 typedef GdkSnapshot                    GtkSnapshot;
index 3ebb1b58672410d162607a4935eed35a5bb21621..558232b9e74f30a697b9b296a4515bee894807bf 100644 (file)
@@ -314,6 +314,7 @@ gtk_public_sources = files([
   'gtkrendericon.c',
   'gtkrendernodepaintable.c',
   'gtkrevealer.c',
+  'gtkroot.c',
   'gtkroundedbox.c',
   'gtkscale.c',
   'gtkscalebutton.c',
@@ -551,6 +552,7 @@ gtk_public_headers = files([
   'gtkrecentmanager.h',
   'gtkrender.h',
   'gtkrevealer.h',
+  'gtkroot.h',
   'gtkscale.h',
   'gtkscalebutton.h',
   'gtkscrollable.h',